﻿Public Class Serve_Page
    Public Sub Initialize()
        TextBoxTableId.Text = ""
        TextBoxMenuId.Text = ""
        TextBoxCount.Text = ""
    End Sub

    Private Sub ButtonOK_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles ButtonOK.Click
        Try
            HallServe.Serve(Convert.ToInt32(TextBoxTableId.Text), TextBoxMenuId.Text, Convert.ToInt32(TextBoxCount.Text))
            MsgBox("上菜完毕!")
        Catch err As Exception
            MsgBox(err.Message)
        End Try
    End Sub

    Private Sub ButtonReSet_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles ButtonReSet.Click
        Initialize()
    End Sub

    Private Sub Serve_Page_KeyDown(sender As Object, e As System.Windows.Input.KeyEventArgs) Handles Me.KeyDown
        If e.Key = Key.Return Then ButtonOK_Click(sender, New RoutedEventArgs)
    End Sub
End Class
